function checkLogin() {
    const loggedinUser = localStorage.getItem("loggedinUser");
    //If no one is logged in we send an alert and go to login.html
    if (!loggedinUser) {
        alert("You are not logged in.You must be to view this page.");
        window.location.href = "../login.html";
    }
}
checkLogin();